Enumerate tracked Cargo manifests in the Dependabot hygiene test (#413)#414
Draft
leynos wants to merge 1 commit into
Draft
Enumerate tracked Cargo manifests in the Dependabot hygiene test (#413)#414leynos wants to merge 1 commit into
leynos wants to merge 1 commit into
Conversation
`cargo_update_directories_match_manifests` walked the file system for `Cargo.toml` manifests, so untracked content inside the checkout — the shared mutation workflow's `workflow-src/` fixtures, build artefacts, scratch directories — leaked into the comparison and failed the mutation run's unmutated baseline in every shard. Enumerate manifests with `git ls-files -z -- '*Cargo.toml'` instead: only tracked manifests count, so untracked pollution is invisible while a newly tracked manifest missing from `.github/dependabot.yml` still fails the test. When the source tree is not a git checkout (the scratch copy cargo-mutants builds in omits `.git`), skip the comparison, as tracked-manifest hygiene is meaningless there.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #413.
The first full mutation run failed its unmutated baseline in every shard because
cargo_update_directories_match_manifestswalked the file system forCargo.tomlmanifests and found the shared mutation workflow's untrackedworkflow-src/checkout, which.github/dependabot.ymllegitimately does not list.This branch implements option 1 from the issue: the test now enumerates manifests with
git ls-files -z -- '*Cargo.toml', so only tracked manifests participate in the comparison and untracked content (workflow-src, build artefacts, scratch directories) becomes invisible. The test's intent is unchanged: a newly tracked manifest directory missing from.github/dependabot.ymlstill fails it. When the source tree is not a git checkout — cargo-mutants builds in a scratch copy that omits.git— the test skips the comparison, since tracked-manifest hygiene is meaningless there.Review walkthrough
tracked_cargo_manifest_dirsin tests/dependabot_config_tests.rs: it shells out togit ls-filesand maps each tracked manifest's parent directory to Dependabot's POSIX form, returningNotAGitCheckoutwhen the tree has no repository.#[expect(clippy::print_stderr)]with a justification).local_action_manifest_dirsstill uses them for the.github/actionsscan, which is confined to tracked configuration.Validation
red_check_crate/Cargo.tomlnot listed independabot.ymlmakescargo_update_directories_match_manifestsFAIL as intended; reverting restores the pass.workflow-src/rust-toy-app/Cargo.tomlinside the checkout (mirroring the shared workflow's fixtures), the full test file passes..git(mirroring the cargo-mutants scratch copy) and with theworkflow-srcpollution present, the test printsskipping: source tree is not a git checkoutand passes.cargo test --all-featurespasses on three consecutive runs (matching the caller'sextra-args).make check-fmt,make lint,make typecheck,make test,make test-workflow-contracts,make test-typos-config,make markdownlint, andmake nixieall pass locally (the Whitaker Dylint suite is unavailable locally and is exercised in CI).